<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php 
			echo $title_for_layout; 			
		?>
	</title>
	
	<meta name="Author" content="Sylwester Kowal"/>
	<meta name="Copyright" content="Sylwester Kowal"/>
	<meta name="Language" content="<?php echo Configure::read('Config.language');?>" />	
	<?php
		$description_for_layout = (isset($description_for_layout)) ? $description_for_layout : '';
		$keywords_for_layout = (isset($keywords_for_layout)) ? $keywords_for_layout : '';
		
		echo $this->Html->meta('icon','/img/'.HOST.'/favicon.ico');echo "\n";
		echo $this->Html->meta('keywords', $keywords_for_layout);echo "\n";
		echo $this->Html->meta('description', $description_for_layout);echo "\n";
	?>
		
	<?php echo $this->Html->script(array(		 
		'jquery-1.4.3.min'
		,'jquery-ui-1.8.16.custom.min'
	),$options = array('allowCache'=>false,'safe'=>false,'inline'=>true));?>
	
	<?php 
		echo $this->Html->css(array(
			'default'		
			,'custom-theme/jquery-ui-1.8.16.custom'
		));
		echo $scripts_for_layout;
	?>
	<link href='http://fonts.googleapis.com/css?family=Anton|Oswald:300,400,700|Gruppo&subset=latin,latin-ext,cyrillic,cyrillic-ext' rel='stylesheet' type='text/css'>
</head>
<body>
<table id="main">
	<tr>
		<td id="top">
			<div id="top-left">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td valign="middle">
							<?php echo $this->Html->link($this->Html->image('home.png'),'/',array('escape'=>false,'alt'=>Configure::read('Config.host'),'title'=>__('Strona główna',true)))?> 
							<label><?php echo __('Strona główna',true) ?></label>
						</td>

						<td valign="middle">	
							<?php echo $this->Html->link($this->Html->image('add.png'),array('controller'=>'pages','action'=>'dodaj'),array('escape'=>false,'alt'=>__('dodaj',true),'title'=>__('Dodaj ogłoszenie',true)))?>
							<label><?php echo __('Dodaj',true) ?></label>
						</td>
					</tr>
				</table>
			</div>
			<div id="top-right">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<?php if($session->check("Auth.User.id")){?>
						<td>
							<?php echo $this->Html->link($this->Html->image('register-more.png',array('align'=>'middle')),array('plugin'=>false,'controller'=>'pages','action'=>'referencje'),array('escape'=>false,'alt'=>__('referencje',true),'title'=>__('Referencje',true)))?>
							<label class="numer-referencyjny"><?php echo 'REF'.date('ym').$session->read("Auth.User.id")?></label>
						</td>	
						<td>
							<?php echo $this->Html->link($this->Html->image('user.png',array('align'=>'middle')),array('plugin'=>false,'controller'=>'users','action'=>'view'),array('escape'=>false,'alt'=>__('view',true),'title'=>__('Twoje konto',true)))?>
							<label><?php echo $session->read("Auth.User.email")?></label>
						</td>						
						<td>
							<?php echo $this->Html->link($this->Html->image('logout.png',array('align'=>'middle')),array('plugin'=>false,'controller'=>'users','action'=>'logout'),array('escape'=>false,'alt'=>__('logout',true),'title'=>__('Wyloguj się',true)))?>
							<label><?php echo __('Wyloguj się',true) ?></label>
						</td>						
			 			<?php }else{?>
						<td>
							<?php echo $this->Html->link($this->Html->image('login.png',array('align'=>'middle')),array('plugin'=>false,'controller'=>'users','action'=>'login'),array('escape'=>false,'alt'=>__('login',true),'title'=>__('Panel logowania',true)))?>
							<label><?php echo __('Zaloguj się',true) ?></label>
						</td>						
						<td>
							<?php echo $this->Html->link($this->Html->image('register.png',array('align'=>'middle')),array('plugin'=>false,'controller'=>'users','action'=>'register'),array('escape'=>false,'alt'=>__('register',true),'title'=>__('Zarejestruj się',true)))?>
							<label><?php echo __('Zarejestruj się',true) ?></label>
						</td>
						<?php }?>
					</tr>
				</table>
			</div>
		</td>		
	</tr>
	<tr>
		<td id="alerts">
			<?php 
				$alert = $this->Session->flash();
				$alert .= $this->Session->flash('auth');
				$alert .= $this->Session->flash('email');
				echo $alert;
			?>
		</td>	
	</tr>
	<tr>
		<td id="content">
			<?php echo $content_for_layout;?>
			<div class="clear"></div>
		</td>
	</tr>
	<tr>
		<td id="bottom">		
				<table width="100%">
					<tr>
						<td align="left">
							<?php if($session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'admin' || $session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'manag'){?>

							<?php echo $this->Html->link($this->Html->image('edytuj.png',array('align'=>'middle')),array('controller'=>'metas','action'=>'edit'),array('escape'=>false,'alt'=>__('help',true),'title'=>__('Ustawienia strony',true)))?>
							<label><?php echo __('Ustawienia strony',true) ?></label>
							
							<?php echo $this->Html->link($this->Html->image('statusy.png',array('align'=>'middle')),array('controller'=>'main_app','action'=>'statusy'),array('escape'=>false,'alt'=>__('statusy',true),'title'=>__('Statusy',true)))?>
							<label><?php echo __('Statusy',true) ?></label>							
							<?php }?>
						</td>
						<td align="right">
							<?php echo $this->Html->link($this->Html->image('sidf.png',array('align'=>'middle')),'http://www.sidf.pl',array('escape'=>false,'alt'=>__('help',true),'title'=>__('Strony Internetowe Dla Firm',true)))?>
							<label><?php echo __('Strony Internetowe Dla Firm',true) ?></label>
						</td>
					</tr>
				</table>
		</td>
	</tr>
</table>
<div class="clear"></div>
<?php echo $this->element('sql_dump');?>
</body>
</html>